< previous page page_982 next page >

Page 982
Customers
Vehicles
VehicleTypes
CustomerID
SerialNumber
VehicleType
(Primary Key)
(Primary Key)
(Primary Key)
CustomerName
CustomerID
Make (Foreign Key)
Address
License
Model
City
VehicleType (Foreign Key)
State
Color
Zip
Odometer
Phone

To reach Third Normal Form, you must delete any fields that do not describe the primary key. A review of all fields shows that you have already eliminated any fields that do not describe the entire primary key.
To achieve Fourth Normal Form, you need to separate any independent one-to-many relationships that can potentially produce unusual answers when you query the data. The Vehicles table does have several one-to-many relationships with the CustomerID and the VehicleType fields. The combination of these two fields in the same table would not, however, lead to misleading results further down the line. Therefore, you do not need to make any changes to reach Fourth Normal Form.
Similarly, no changes need to be made to reach Fifth Normal Form because you have no dependent many-to-many relationships in your tables. Most data structures do not require you to use the fourth and fifth rules of normalization to optimize your structure.
As a final point, you might want to add a Comments field to each table. This allows users to store any miscellaneous data they choose to track. Adding a memo field to track comments is a good idea in almost every table, because memo fields do not take up room when empty, and they provide great flexibility to your system.
2. The following SQL code builds these tables:
Note.gif
Please note that you need to create the VehicleTypes table before the Vehicles table. This is required because the Vehicles table has a foreign key constraint to the VehicleTypes table. In such situations, the foreign key must be defined prior to its use in another table, or an error occurs.

Create Table Customers
   (CustomerID TEXT (10),
     CustomerName TEXT (40),

 
< previous page page_982 next page >

If you like this book, buy it!